package com.wjw.service.impl;


import com.wjw.mapper.UserMapper;
import com.wjw.entity.User;
import com.wjw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    @Transactional
    public User login(User user) {
        User userDB = userMapper.login(user);
        if(userDB != null){
            return userDB;
        }
        throw new RuntimeException("登录失败");
    }

}
